<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>订单</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/jsp/common/commonJs.jsp"%>
</head>
<script>

</script>
<%@ include file="/jsp/head_bus.jsp"%>
<script>
window.onload=function(){
	$("title").html("我的业务-合同签署");
}
</script>
<!--内容开始-->
<div class="container">
    <ol class="breadcrumb">
      <li><a href="#">首页</a></li>
      <li><a href="#">订单管理</a></li>
      <li class="active">合同生成</li>
    </ol>
    <div class="ct-content f15">
        <form action="">
            <div class="pact pact-1">
     				<span id="hetong">${contract_content}</span>
                </div>
               <div class="checkbox text-center mt20 mb80">
                  <label>
                  <input type="checkbox" name="gx"> 确认以上合同内容无误，同意合同内所有条款，确认签署合同
                  </label>
               </div>               
                <div class="form-group">
                    <div class="text-center">
                          <button id="qr" type="button" onclick="contract_tj('${orderNo}','${orderId}')" class="btn btn-280">确认生成</button>
                    </div>
               </div>
        </form>
    </div>

</div>
<script>
function contract_tj(orderNo,orderId)
{

 		var flag=true;
	 $("input").each(function(){
 			if(!this.checked){
 				flag=false;
 			}
	 	});
	 	if(!flag){
	 		alert("请确认合同内容无误,在进行提交");
	 		return;
	 	}
 		var hetong=$("#hetong").html();
	$.ajax({
	       cache: true,
	       type: "POST",
	       url:"${path}/compact/insertContent.do",
	       dataType : 'json',
	       data:{orderNo:orderNo,hetong:hetong,orderId:orderId},
	       async: false,
	       success: function(data)
	       {
	       		if(data.status)
	       		{
	       			alert(data.msg);
	            	window.location.href="${path}/compact/compactList.do";
           		}else{
           			alert(data.msg);
           		}
	
	       }
	 }); 

}
</script>



<%@ include file="/jsp/foot_bus.jsp"%>